package com.credit.util;

import java.util.Date;

import com.credit.entity.CreditPointsRecord;
import com.credit.service.CreditPointsService;

public class PointsUtil {

	public static void addScoreLog(Long userId, int score, String name) {
		
		CreditPointsService creditPointsService = (CreditPointsService) ApplicationContextUtils.getBean("creditPointsService");
		CreditPointsRecord pointsRecord = new CreditPointsRecord();
		pointsRecord.setUserId(userId);
		pointsRecord.setName(name);
		pointsRecord.setPoints(score);
		pointsRecord.setCreateTime(new Date());
		
		creditPointsService.addPointsRecord(pointsRecord);
		
	}

}
